package edu.cuit.zhuyimeng.uaa.controller.vo;

import edu.cuit.zhuyimeng.framework.common.enums.GenericPatterns;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

/**
 * 注册VO
 */
@Data
@Schema(name = "RegisterVO", description = "注册VO")
public class RegisterVO {

    /**
     * 用户名
     */
    @Schema(description = "用户名(loginId)")
    @Length(min = 3, max = 15, message = "用户名长度必须在3-15之间")
    @Pattern.List({
            @Pattern(regexp = GenericPatterns.NOT_CONTAIN_SPACE, message = "用户名不能包含空格"),
            @Pattern(regexp = GenericPatterns.ONLY_LETTER_NUMBER, message = "用户名只能包含字母和数字")
    })
    private String username;

    /**
     * 昵称
     */
    @Schema(description = "昵称")
    @Length(min = 3, max = 15, message = "昵称长度必须在3-15之间")
    @Pattern(regexp = GenericPatterns.NOT_CONTAIN_SPACE, message = "昵称不能包含空格")
    private String nickname;

    /**
     * 密码
     */
    @Schema(description = "密码")
    @Length(min = 6, max = 40, message = "密码长度必须在6-40之间")
    private String password;

    /**
     * 邮箱
     */
    @Schema(description = "邮箱")
    @Pattern(regexp = GenericPatterns.EMAIL, message = "邮箱号不正确")
    private String email;

    /**
     * 手机号
     */
    @Schema(description = "手机号")
    @Pattern(regexp = GenericPatterns.CHINA_PHONE, message = "手机号格式不正确")
    private String phone;

}
